package com.yyfax.pay.depository.dao;

import org.apache.ibatis.annotations.Param;

import com.yyfax.pay.depository.domain.FuiouChangeCard;

/**
 * 用户更换银行卡DAO
 *
 * @author yejc
 * @date 2017-11-09
 * @since v2.0.0
 */
public interface FuiouChangeCardDao {
	/**
	 * 根据主键删除
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int deleteByPrimaryKey(String busiId);

	/**
	 * 保存实体对象
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int insert(FuiouChangeCard record);

	/**
	 * 根据主键查询
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	FuiouChangeCard selectByPrimaryKey(String busiId);

	/**
	 * 根据主键更新
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 */
	int updateByPrimaryKey(FuiouChangeCard record);

	/**
	 * 根据订单号和商户号查询
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 * @param orderId
	 * @param merchantCode
	 * @return
	 */
	FuiouChangeCard selectByOrderIdMerchantCode(@Param("orderId") String orderId, @Param("merchantCode") String merchantCode);

	/**
	 * 根据主键和状态更新状态
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 * @param oriState
	 * @param tarState
	 * @param busiId
	 * @param currentDateTime
	 * @return
	 */
	int updateStateByBusiId(@Param("oriState") String oriState, @Param("tarState") String tarState, @Param("busiId") String busiId,
			@Param("currentDateTime") String currentDateTime);

	/**
	 * 根据主键更新状态和响应
	 *
	 * @author yejc
	 * @date 2017-11-09
	 * @since v2.0.0
	 * @param state
	 * @param busiId
	 * @param currentDateTime
	 * @param rspCode
	 * @param rspMsg
	 * @return
	 */
	int updateStateAndRspByBusiId(@Param("state") String state, @Param("busiId") String busiId, @Param("currentDateTime") String currentDateTime,
			@Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);

	/**
	 * 更新更换银行订单状态
	 * 
	 * @author buyi
	 * @date 2018-03-29 17:13:15
	 * @since v2.1.3
	 * @param oriState
	 * @param tarState
	 * @param busiId
	 * @param rspCode
	 * @param rspMsg
	 * @return
	 */
	public int updateStateFromOriStateByBusiId(@Param("busiId") String busiId, @Param("oriState") String oriState, @Param("tarState") String tarState,
			@Param("rspCode") Integer rspCode, @Param("rspMsg") String rspMsg);

	/**
	 * 更新更换银行卡实际图片地址
	 * 
	 * @author buyi
	 * @date 2018-03-29 17:16:06
	 * @since v2.1.3
	 * @param busiId
	 * @param actImageFilePath
	 * @return
	 */
	public int updateActImageFile1(@Param("busiId") String busiId, @Param("actImageFile1") String actImageFilePath1);
}